'''

装饰器

'''
import time

def writeLog(func):
    try:
        file = open("log1.txt","a",encoding="utf-8")
        file.write(func.__name__)
        file.write("\t")
        file.write(time.asctime())
        file.write("\n")
    except Exception as e:
        print(e)
    finally:
        file.close()

def funcOut(func):
    def funcIn():
        writeLog(func)
        func()
    return funcIn

@funcOut
def func1():
    print("111")
@funcOut
def func2():
    print("222")

# func1 = funcOut(func1)
# func2 = funcOut(func2)

func1()
func2()